<template>
  <list-page
    v-model:list="goodsList"
    :requestParams="{}"
    :requestMethod="init"
    ref="listPageRef"
  >
    <template #default>
      <view class="u-p-20" style="box-sizing: border-box;">
        <up-grid
          :border="false"
          :col="2"
          gap="20px"
        >
          <up-list-item v-for="(item, index) in goodsList" :key="index">
            <up-grid-item>
              <goods-item
                :data="item"
                type="vertical"
                size="calc(50vw - 20px)"
              ></goods-item>
            </up-grid-item>
          </up-list-item>
        </up-grid>
      </view>
    </template>
  </list-page>
</template>

<script>
import goodsItem from '@/components/goods-item/goods-item.vue';
export default {
  components: {
    goodsItem
  },
  data() {
    return {
      goodsList: []
    }
  },
  methods: {
    init(params) {
      return this.$api.goods.history(params)
    },
    reloadList() {
      this.$nextTick(() => {
        this.$refs.listPageRef.reset()
      })
    },
  },
  onLoad() {
    this.reloadList()
  }
}
</script>

<style lang="scss" scoped>
.classify-content {
  width: 100%;
}
.left {
  width: 200rpx;
  height: 100%;
  border-right: 1rpx solid $u-border-color;
  overflow: scroll;
}
.right {
  flex: 1;
  height: 100%;
  padding: 0.1rpx;
  box-sizing: border-box;
}
</style>